<template>
	<view class="">
		<view class="imgs-list">
			<view @click="openImg(item,index)" class="imgs-item" :style="{width:itemStyle.width,height:itemStyle.height}" v-for="(item,index) in currentImgs" :key="index">
				<video v-if="item.img_type == 5" id="myVideo" :src="item.src" style="width: 90%;height: 100%; border-radius: 20rpx;background: #ccc;"></video>
				<image v-else :src="item.src" style="width: 90%;height: 100%; border-radius: 20rpx;background: #ccc;" mode="aspectFill">
				</image>
			</view>
		</view>
		
		
		<modal ref="modal"></modal>
	</view>
</template>

<script>
	export default {
		props:{
			itemStyle:{
				type:Object,
				default:()=>{}
			},
			currentImgs:{
				type:Array,
				default:()=>{}
			}
		},
		mounted() {
			
		},
		data(){
			return {
				
			}
		},
		methods:{
			openImg(item,index){
				var vipConfig = uni.getStorageSync('vipConfig')
				var user = uni.getStorageSync('user')
				if (!user && vipConfig.isSearchLogin) {
					this.$refs['modal'].modalName = 'Modal'
					return
				}
				console.log(user,11111111111111)
				uni.navigateTo({
					url:"/pages/common/works-details?framer_id="+item.framer_id  + '&img_type='+item.img_type + "&up_img=" + item.src
				})
			}
			
		}
	}
</script>

<style scoped lang="scss">
	.imgs-list {
		display: flex;
		align-items: center;
		flex-wrap: wrap;
		.imgs-item {
			display: flex;
			align-items: center;
			justify-content: center;
			width: 25%;
			height: 150rpx;
			border-radius: 20rpx;
			margin-bottom: 15rpx;
		}
	}
</style>